from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1266777654.3236811
_template_filename='/home/joel/old-gamma/onlinelinguisticdatabase/templates/derived/form/paginator.html'
_template_uri='/derived/form/paginator.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 3
    ns = runtime.Namespace('formViews', context._clean_inheritance_tokens(), templateuri='/base/formViews.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, 'formViews')] = ns

def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, '/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, 'formViews')._populate(_import_ns, ['*'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        formViews = _mako_get_namespace(context, 'formViews')
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 3
        __M_writer(u'\n\n\n')
        # SOURCE LINE 12
        __M_writer(u'\n\n')
        # SOURCE LINE 14
        if len(c.paginator):
            # SOURCE LINE 15
            __M_writer(u'<p id="paginatorPager">')
            __M_writer(escape( c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last') ))
            __M_writer(u'</p>\n\n')
            # SOURCE LINE 17
            counter=0 
            
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['counter'] if __M_key in __M_locals_builtin()]))
            __M_writer(u'\n')
            # SOURCE LINE 18
            for form in c.paginator:
                # SOURCE LINE 19
                __M_writer(u'    ')
                __M_writer(escape(formViews.formViewLong(form)))
                __M_writer(u'\n    ')
                # SOURCE LINE 20
                counter += 1 
                
                __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['counter'] if __M_key in __M_locals_builtin()]))
                __M_writer(u'\n')
            # SOURCE LINE 22
            __M_writer(u'\n<p>')
            # SOURCE LINE 23
            __M_writer(escape( c.paginator.pager('~2~') ))
            __M_writer(u'</p>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, 'formViews')._populate(_import_ns, ['*'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 6
        __M_writer(u'\n')
        # SOURCE LINE 7
        if c.paginator.item_count == 1:
            # SOURCE LINE 8
            __M_writer(u'    <h1 class="heading">Form Results: ')
            __M_writer(escape(c.paginator.item_count))
            __M_writer(u' match</h1>\n')
            # SOURCE LINE 9
        else:
            # SOURCE LINE 10
            __M_writer(u'    <h1 class="heading">Form Results: ')
            __M_writer(escape(c.paginator.item_count))
            __M_writer(u' matches</h1>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


